package com.zhoushihao.class0820;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        try (
                FileInputStream fis = new FileInputStream("./src/com/neusoft/zhoushihao/class0820/preview.jpg");
                FileOutputStream fos = new FileOutputStream("./src/com/neusoft/zhoushihao/class0820/xxx.jpg")
        ) {
            byte[] bytes = new byte[1024];
            int length;
            while ((length = fis.read(bytes)) > 0) {
                fos.write(bytes, 0, length);
            }

//            byte[] bytes = new byte[fis.available()];
//            int read = fis.read(bytes);
//            System.out.println(read);
//            fos.write(bytes);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
